Skip to main content

RealtimeSet<TValue>

RealtimeSet<TValue>

RealtimeSet is a special model type that represents an unordered collection of models. Internally this is used for things like keeping track of all RealtimeViews in the scene. If order is not important, this collection is the recommended collection to use for storing collections of models. All updates are applied instantly and are rolled back if rejected by the server (due to ownership). Adding or removing items sends the minimal amount of information to the server in order to perform the update on all clients. The whole collection is not sent every time.

Events

modelAdded

event ModelAdded<TValue> modelAdded

An event that fires when a model is added locally or remotely.

modelRemoved

event ModelRemoved<TValue> modelRemoved

An event that fires when a model is removed locally or remotely.

Properties

Count

int Count { get; }

The number of models currently stored in the collection.

Methods

Add

bool Add(TValue value)

Add a model to the collection

  • value:The model to add. This value cannot be null.
  • Remove

    bool Remove(TValue value)

    Remove a model from the collection.

    A boolean to indicate whether the model was contained within the collection.

  • value:The model to remove.
  • GetEnumerator

    IEnumerator<TValue> GetEnumerator()

    GetCollectionTypeID

    uint GetCollectionTypeID()